#ifndef PROFILEMANAGERCREATEPROFILE_H
#define PROFILEMANAGERCREATEPROFILE_H

#include <QDialog>
#include <QScrollArea>
#include <QSpinBox>
#include <QVector>

#include "ui_locale.h"
#include "ui_profilemanagereditprofile.h"
#include "profilemanager.h"

#define DATABASE_SQLITE_INFO	"<html><head><meta name=\"qrichtext\" content=\"1\" /><style type=\"text/css\">\np, li { white-space: pre-wrap; }\n</style></head><body style=\" font-family:'MS Shell Dlg 2'; font-size:8.25pt; font-weight:400; font-style:normal;\">\n<p style=\" margin-top:0px; margin-bottom:0px; margin-left:0px; margin-right:0px; -qt-block-indent:0; text-indent:0px;\"><span style=\" font-size:10pt; font-weight:600;\">SQLite:</span><span style=\" font-size:10pt;\"> A SQLite3 database requires no extra values for the bot to use it. There is however one optional value, and that is the name of the database file that the bot will save stats and information. A SQLite3 database saves everything to a local file. This is recommended for new users that do not quite understand how to setup a MySQL database. However, it is recommended that once you understand how to use the bot to upgrade to MySQL as it is much faster.</span></p></body></html>"
#define DATABASE_MYSQL_INFO		"<html><head><meta name=\"qrichtext\" content=\"1\" /><style type=\"text/css\">\np, li { white-space: pre-wrap; }\n</style></head><body style=\" font-family:'MS Shell Dlg 2'; font-size:8.25pt; font-weight:400; font-style:normal;\">\n<p style=\" margin-top:0px; margin-bottom:0px; margin-left:0px; margin-right:0px; -qt-block-indent:0; text-indent:0px;\"><span style=\" font-size:10pt; font-weight:600;\">MySQL:</span><span style=\" font-size:10pt;\"> A MySQL database requires several values for the bot to use it. These are defined below and will be explained in the tooltips of each field. In general, a MySQL database is the recommended database type, but requires some setting up for you to do to get it up and running.</span></p></body></html>"

#define NUMBER_BNET_CONNECTIONS	10

class CProfileManagerEditProfile: public QDialog, public Ui::ProfileManagerEditProfile
{
	Q_OBJECT

private:
	int m_BNETServers;

	CProfileManager *m_Parent;
	QHBoxLayout *m_DatabaseMySQLHorizontalLayoutDatabase;
	QHBoxLayout *m_DatabaseMySQLHorizontalLayoutPassword;
	QHBoxLayout *m_DatabaseMySQLHorizontalLayoutPort;
	QHBoxLayout *m_DatabaseMySQLHorizontalLayoutServer;
	QHBoxLayout *m_DatabaseMySQLHorizontalLayoutUser;
	QHBoxLayout *m_DatabaseSQLiteHorizontalLayout;
	QLabel *m_DatabaseInfo;
	QLabel *m_DatabaseMySQLDatabaseLabel;
	QLabel *m_DatabaseMySQLPasswordLabel;
	QLabel *m_DatabaseMySQLPortLabel;
	QLabel *m_DatabaseMySQLServerLabel;
	QLabel *m_DatabaseMySQLUserLabel;
	QLabel *m_DatabaseSQLiteFileNameLabel;
	QLineEdit *m_DatabaseMySQLDatabaseLineEdit;
	QLineEdit *m_DatabaseMySQLPasswordLineEdit;
	QLineEdit *m_DatabaseMySQLServerLineEdit;
	QLineEdit *m_DatabaseMySQLUserLineEdit;
	QLineEdit *m_DatabaseSQLiteFileNameLineEdit;
	QSpacerItem *m_DatabaseMySQLPortVerticalSpacer;
	QSpacerItem *m_DatabaseVerticalSpacer;
	QSpinBox *m_DatabaseMySQLPortSpinBox;
	QString m_Profile;
	QVBoxLayout *m_DatabaseSubGroupBoxLayout;

	// BNET Vectors

	QVector<QGroupBox *> m_BNETGroupBoxes;
	QVector<QGroupBox *> m_BNETPvPGNGroupBoxes;
	QVector<QCheckBox *> m_BNETCheckBoxes;
	QVector<QCheckBox *> m_BNETHoldClans;
	QVector<QCheckBox *> m_BNETHoldFriends;
	QVector<QCheckBox *> m_BNETPublicCommands;
	QVector<QCheckBox *> m_BNETPvPGNConnections;
	QVector<QComboBox *> m_BNETRootAdmins;
	QVector<QPushButton *> m_BNETAddRAs;
	QVector<QPushButton *> m_BNETCountryCodeLists;
	QVector<QPushButton *> m_BNETLanguageCodeLists;
	QVector<QPushButton *> m_BNETRemoveRAs;
	QVector<QLabel *> m_BNETCountryCodeNotes;
	QVector<QLabel *> m_BNETLanguageCodeNotes;
	QVector<QSpinBox *> m_BNETCountryCodes;
	QVector<QSpinBox *> m_BNETLanguageCodes;
	QVector<QSpinBox *> m_BNETPvPGNMaxMessageLengths;
	QVector<QLineEdit *> m_BNETCommandTriggers;
	QVector<QLineEdit *> m_BNETFirstChannels;
	QVector<QLineEdit *> m_BNETPasswords;
	QVector<QLineEdit *> m_BNETPvPGNW3Versions;
	QVector<QLineEdit *> m_BNETPvPGNEXEVersions;
	QVector<QLineEdit *> m_BNETPvPGNEXEVersionHashes;
	QVector<QLineEdit *> m_BNETPvPGNPasswordHashTypes;
	QVector<QLineEdit *> m_BNETPvPGNRealmNames;
	QVector<QLineEdit *> m_BNETRoCCDKeys;
	QVector<QLineEdit *> m_BNETServerAliases;
	QVector<QLineEdit *> m_BNETServersV;
	QVector<QLineEdit *> m_BNETTFTCDKeys;
	QVector<QLineEdit *> m_BNETUsernames;

private slots:
	void ActionAddRootAdmin();
	void ActionApply();
	void ActionApplyEnable(const QString &str = QString());
	void ActionCheckBoxBNETPvPGNStateChanged(int state);
	void ActionCheckBoxBNETStateChanged(int state);
	void ActionCheckBoxStateChanged(int state);
	void ActionCheckBoxTFTChanged(int state);
	void ActionCountryCodeChanged(int val);
	void ActionLanguageCodeChanged(int val);
	void ActionDatabaseTypeChanged(int index);
	void ActionLogMethodChange();
	void ActionOpenLocaleCodeList();
	void ActionRemoveRootAdmin();
	bool ActionAccept(bool apply = false);

public:
	CProfileManagerEditProfile(const QString &profile, CProfileManager *parent = 0);
	~CProfileManagerEditProfile();
};

class CLocale: public QDialog, public Ui::Locale
{
	Q_OBJECT

public:
	CLocale(bool lang, CProfileManagerEditProfile *parent = 0);
	~CLocale();
};

#endif // PROFILEMANAGERCREATEPROFILE_H
